<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>load_class (Spec::Runner::Options)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/runner/options.rb, line 156</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_class</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">kind</span>, <span class="ruby-identifier">option</span>)
        <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/</span>
          <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">$2</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">$2</span>
          [<span class="ruby-identifier">$1</span>, <span class="ruby-identifier">arg</span>]
        <span class="ruby-keyword kw">else</span>
          <span class="ruby-identifier">m</span> = <span class="ruby-node">&quot;#{name.inspect} is not a valid class name&quot;</span>
          <span class="ruby-ivar">@err</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">m</span>
          <span class="ruby-identifier">raise</span> <span class="ruby-identifier">m</span>
        <span class="ruby-keyword kw">end</span>
        <span class="ruby-keyword kw">begin</span>
          <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">binding</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>)
        <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
          <span class="ruby-ivar">@err</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Couldn't find #{kind} class #{name}&quot;</span>
          <span class="ruby-ivar">@err</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Make sure the --require option is specified *before* #{option}&quot;</span>
          <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$_</span><span class="ruby-identifier">spec_spec</span> ; <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span> ; <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">exit</span>(<span class="ruby-value">1</span>) ; <span class="ruby-keyword kw">end</span>
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>